Repository navigation
id: joined builder/moderator session frames (design #835 phase 3) - #8494
Conversation
Implements #8036, the session half of design #835 phases 3: a joined session can now act on its live capability instead of the admin secret. - install_begin accepts an omitted admin token in joined sessions and installs through the new WorldService::install_wasm_authorized: an early BUILDER scope check before bytes are received, the admin path's upload safeguards (shared receive_module_upload), the module trust gate, and the actor's own re-check at the effect boundary via install_program_authorized, which derives the BuilderInstalled audit actor from the capability. A joined frame carrying an admin token is refused as mixed credentials; the pre-join path is unchanged and now refuses a missing token explicitly. Builder installs are Wasm-only: a native artifact is refused even where native execution is enabled. - New joined revoke frame: a moderator's session revokes a participant through revoke_authorized; the audit actor is derived inside the actor, never from the frame. Success (or a no-op inactive target) replies with the new revoked server frame. - Denials of joined role actions carry the stable actor_denied code on the error frame (new optional field; omitted for every existing error, whose serialized shape is unchanged). The world actor gains WorldCommand::AuthorizeScope / WorldHandle::authorize so session paths can classify a denial before doing work; the authorized operation commands still re-check at the boundary. - Shell contract revision 6: install_begin phases add joined and its admin_token becomes optional, revoke (admin, joined) and revoked (reply) frames are named, error gains the optional code field. Tests: eight new SessionIo tests cover builder install with journal attribution, guest install/revoke actor_denied denials, mixed credentials, mid-upload revocation, native refusal, pre-join token omission, and moderator revoke with disconnect + journal attribution. world_session + shell_contract 79 passed; world:: 274 passed; tests/world_roles 7 passed.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 43 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ae5e39a8d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "phases": ["opening", "joined"], | ||
| "opens": "install", |
There was a problem hiding this comment.
Track joined uploads in the conformance state machine
For a valid joined builder upload, Conformance::client in src/shell_contract.rs remains in Phase::Joined after install_begin: it only applies a frame's opens transition in Phase::Opening. Consequently, the subsequent install_chunk and install_end frames are rejected because their contract phases are exclusively install, and check_contract rejects transcripts produced by the newly supported flow. Update the conformance state machine to enter the upload phase from a joined session and return to joined, rather than closed, when that upload ends.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in cdd39d5 (head now 6f28758, which also merges current main).
Conformance now records the phase an upload returns to when the upload opens: install_begin from Joined enters Install with return phase Joined; install_end returns there instead of Closed, and a refusal error during the upload returns there too (a refused joined upload does not end the session). Only an upload opens a phase from Joined — the opens values on joined query/admin frames stay non-transitional, as the existing joined-session conformance tests require.
Coverage: new shell_contract assertions run the joined upload sequence (join → install_begin → upload_ready → install_chunk → install_end → chat) and the refused variant (error instead of upload_ready), both conforming and ending in Joined. cargo test -p id --lib: 2648 passed; the only failure is the pre-existing frames::tests::byte_refusal... breakage tracked in #8354, which fails identically on pristine main.
| .install_program_authorized( | ||
| token, | ||
| module_hash.clone(), | ||
| seed, | ||
| Some(crate::world::ModuleProvenance::Artifact), | ||
| guest, |
There was a problem hiding this comment.
Preserve the publisher trust decision for builder installs
When a builder installs a module signed by a configured trusted publisher, this call loses the admission decision: WorldHandle::install_program_authorized hardcodes trust: None, which the actor copies into the durable ProgramInstalled event. Unlike the existing admin installer, the new path therefore journals neither SignatureVerified nor the publisher key, even though it verified the signature. That leaves journal/history consumers unable to establish which publisher authorized the installed artifact. Derive the same TrustDecision as the admin upload path and carry it through the capability-authorized install command.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in cdd39d5 (head now 6f28758, which also merges current main).
WorldHandle::install_program_authorized no longer hardcodes trust: None: it takes the caller's TrustDecision and carries it through InstallProgramAuthorized into the durable ProgramInstalled event. WorldService::install_wasm_authorized derives the same decision as the admin upload path — SignatureVerified with the publisher key when a trust list is configured, NoTrustList when none is — immediately after the same verify_module_signature gate.
Coverage: tests/world_roles asserts the authorized install journals the supplied decision in the Committed/ProgramInstalled event; a new world_session test has a joined builder install a trusted signer's module and asserts SignatureVerified + publisher in the journal, and the existing builder install test now also asserts the NoTrustList decision is recorded.
| .await | ||
| .map_err(|_| InstallError::Unavailable)?; |
There was a problem hiding this comment.
Preserve actor-denied errors from the final authorization check
If the builder capability expires or a queued revocation executes between the preceding authorize command and install_program_authorized, the actor correctly refuses activation, but this mapping converts that authorization denial into Unavailable. The session then emits an activation failure without the promised actor_denied code. The moderator path has the same race between its preliminary check and revoke_authorized, whose denial becomes an uncoded revoke failed error. Classify authorization failures returned by the operation commands themselves, rather than relying on a separate preliminary check, so final-boundary denials retain the stable wire code.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in cdd39d5 (head now 6f28758, which also merges current main).
Classification now comes from the operation commands' own errors: capability denials in the world core are typed (world::CapabilityDenied; the non-oracular messages are unchanged), and the session classifies the errors returned by install_program_authorized and revoke_authorized via world::is_capability_denied. A denial at the final boundary — capability expired, or a revocation landed, after the preliminary authorize check — therefore keeps the actor_denied wire code on both paths; non-denial failures (journal/actor errors) keep their existing uncoded failure replies. The preliminary check remains only as the early, pre-upload classification.
Coverage: tests/world_roles asserts both commands' denials are classifiable (is_capability_denied) from the returned error; the existing session test for a builder revoked mid-upload still passes, and the full pkgs/id lib suite passes except the pre-existing #8354 failure (fails identically on pristine main).
|
state: parked (Codex findings block merge — fix is the resume step) State advanced past the last checkpoint: the prior uncommitted implementation was committed as 0ae5e39 on branch queue/14374-8036-joined-frames and PR #8494 is OPEN. Re-verified fresh this shift: issue #8036 OPEN, no hard-stop labels, no status/needs-triage; PR head matches the Codex-reviewed commit. CI rollup: 11 QUEUED, 1 SUCCESS, 1 SKIPPED, 1 NEUTRAL. Codex gate (§5) — BLOCKS MERGE: the Codex review on commit 0ae5e39 completed with has_any_findings=true, has_unresolved_findings=true. Three P2 findings, all read as valid on inspection:
Terminal for this shift: task 14374 parked. Resume: fix all three findings on branch queue/14374-8036-joined-frames (worktree /home/user/git/fleet/queue-14374-8036-joined-frames), run the pkgs/id cargo tests, push, disposition each Codex thread on PR #8494, then merge on green CI and complete task 14374 / close issue #8036. |
- shell contract conformance: a joined install_begin enters the upload phase and install_end (or a refusal) returns to joined, not closed, so conformance accepts the newly supported flow. - authorized install: derive the publisher trust decision in the session path and carry it through install_program_authorized into the durable ProgramInstalled event, as the admin path does. - actor_denied classification: capability denials from the world core are typed (CapabilityDenied); the session classifies the operation commands own errors (install_program_authorized, revoke_authorized) so final-boundary denials keep the wire code. Tests: world_roles (trust carried + denial classification), world_session (mid-upload revocation still actor_denied; signed builder install journals SignatureVerified + publisher; unsigned records NoTrustList), shell_contract (joined upload conformance).
…ed-frames # Conflicts: # pkgs/id/src/world_session/mod.rs
Closes #8036 — design #835 phase 3, the session half (phases 1–2 landed in #4535 and #8034: the journal gate and the actor-authorized operations). A joined session can now act on its live capability instead of the admin secret.
What changed
Joined builder install (
install_beginin a joined session)admin_tokenis now optional on the frame. A joinedinstall_beginthat omits it installs on the session capability's authority; one that carries it is refused as mixed credentials before any scope check. The pre-join admin path is unchanged, except a missing token there is now refused explicitly ("module install denied") instead of failing the admin comparison.WorldService::install_wasm_authorized: earlyBUILDERcheck before any upload bytes are received, then the admin path's exact safeguards (the chunk loop is now a sharedreceive_module_upload), the publisher trust gate, module-directory save, blob pin — and the actor's own re-check at the effect boundary ininstall_program_authorized, which derives theBuilderInstalled { by }audit actor from the capability. No session-supplied value names the actor.InvalidModuleeven on hosts with native execution enabled, so builder authority can never reach the native installer.Joined moderator revoke (new
revokeclient frame)participant_id; handled viarevoke_authorized(phase 2), so the journal'sRevoked { by }is actor-derived. Success — and the no-op inactive-target case (revoked: false, no journal record) — replies with the newrevokedserver frame. The victim's session is closed by the existing revocation broadcast.Stable denial code
ServerFrame::Errorgains an optionalcode, omitted for every existing error (serialized shape unchanged). Joined role denials use exactlyactor_denied— one non-oracular code for invalid, expired, revoked, and insufficient capabilities, mirroring the CapError code from the capability layer.WorldCommand::AuthorizeScope/WorldHandle::authorizelets session paths classify a denial before doing work (before receiving upload bytes; before attempting a revoke). The operation commands still re-check inside the actor, so a capability revoked mid-upload is refused at the boundary — covered by a test that revokes the builder afterupload_readyand asserts no activation and noBuilderInstalledjournal entry.Shell contract revision 6 —
install_beginphases addjoinedandadmin_tokenbecomesstring?;revoke(admin class, joined) andrevoked(reply) frames named;errorgainscode: string?. The CLI contract-check expectation moves to v1.6 with it.Tests
Eight new SessionIo tests in
world_session::tests: builder install + journal attribution + program live; guest install deniedactor_deniedwith session surviving; mixed credentials; mid-upload revocation; native upload refused; pre-join token omission; moderator revoke + victim disconnect + journal attribution + no-op re-revoke; guest revoke denied.cargo test --lib -- world_session:: shell_contract::— 79 passedcargo test --lib -- world::— 274 passedcargo test --test world_roles— 7 passedWorked by the repo-health queue worker (lane code-g, task 14374) from the phase-3 scope in #8036 and design
doc/2026-11-01_design_id835.md§5.🤖 agent-note:v1 — queue task 14374 (lane code-g). Phase 3 of design #835; phases 1–2 already merged (#4535, #8034).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.